package com.info.zhiduoduo.admin.model.vo.partner;

import com.info.zhiduoduo.repository.dto.crm.PartnerKpiDto;

import java.math.BigDecimal;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class PartnerKpiDataVO {

	private int partnerid;

	@ApiModelProperty("kpi:注册企业 (完成注册及审核（根据企业注册时填写的邀请码）)")
	private int compRegiKpi;
	@ApiModelProperty("已完成:注册企业 (完成注册及审核（根据企业注册时填写的邀请码）)")
	private int compRegi;

	@ApiModelProperty("kpi:邀请企业(填写申请推荐数)")
	private int invitationCompKpi;
	@ApiModelProperty("已完成:邀请企业(填写申请推荐数)")
	private int invitationComp;

	@ApiModelProperty("kpi:新增二级合伙人(推荐合伙人注册数)")
	private int newlySecondPartKpi;
	@ApiModelProperty("已完成:新增二级合伙人(推荐合伙人注册数)")
	private int newlySecondPart;

	@ApiModelProperty("kpi:企业交易额(自己关联企业代付金额总数)")
	private BigDecimal compDealKpi;
	@ApiModelProperty("已完成:企业交易额(自己关联企业代付金额总数)")
	private BigDecimal compDeal;

	@ApiModelProperty("kpi:交易企业数(自己关联企业发送交易)")
	private int compDealNumKpi;
	@ApiModelProperty("已完成:交易企业数(自己关联企业发送交易)")
	private int compDealNum;

	public static PartnerKpiDataVO of(PartnerKpiDto partnerKpiDto) {
		if (partnerKpiDto == null) return null;

		return new PartnerKpiDataVO().setCompRegiKpi(partnerKpiDto.getCompRegi())
				.setInvitationCompKpi(partnerKpiDto.getInvitationComp())
				.setNewlySecondPartKpi(partnerKpiDto.getNewlySecondPart())
				.setCompDealKpi(partnerKpiDto.getCompDeal())
				.setCompDealNumKpi(partnerKpiDto.getCompDealNum());
	}
}
